#ifndef __COMMON_H__
#define __COMMON_H__


#define PI 3.1415926535897

#define TOTAL_PARTS 360

namespace Common {
	bool AppendEntity(AcDbEntity* pEnt, AcDbObjectId& objId);

	void SplitStr(CStringArray &saDatas, const CString &csString, const CString &csDivideStr = _T(";"));

	AcDbObjectId DrawLine(double sx, double sy, double ex, double ey);
	AcDbObjectId DrawPoint(double sx, double sy);
	AcDbObjectId DrawCircle(AcGePoint3d pos, double radius);
	AcDbObjectId DrawArc(AcGePoint3d pos, double radius,AcGePoint3d p1, AcGePoint3d p2,bool bClockWise = true);
	AcDbObjectId DrawPolyline2D(const AcGePoint2dArray& Nodes,bool bClosed = false);

	bool setEntLayer(AcDbObjectId id, CString layer);

	bool GetEntNodesList(ads_name ent, AcGePoint2dArray& nodes);
	bool GetEntNodesList(AcDbObjectId id, AcGePoint2dArray& nodes);
	bool GetEntNodesList(AcDbEntity* pEnt, AcGePoint2dArray& nodes);

	bool ssFromNodes(AcGePoint2dArray Nodes, ads_name ssname, TCHAR *Way, const struct resbuf * filter = NULL);

	bool GetMiniRectangle(const AcGePoint2dArray& nodes, AcGePoint2dArray& rect_nodes_4);

	double distOF2d(AcGePoint2d pt1, AcGePoint2d pt2);

	

	//bool CloseWithLines();
}


#endif